<?php
/**
 * Created by PhpStorm.
 * User: dmy
 * Date: 2017/7/13
 * Time: 上午8:37
 */

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class BaseModel extends Model
{
    use SoftDeletes;

    protected $guarded = [
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'deleted_at'
    ];

    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */
    protected $dates = ['deleted_at'];

    public static function getClassName()
    {
        return get_called_class();
    }

    public static function getSimpleClassName()
    {
        $tmp = get_called_class();
        $pos = strrpos($tmp, '\\');
        if ($pos) {
            return substr($tmp, $pos + 1);
        } else {
            return $tmp;
        }
    }

}